package com.example.smartall.utils;

import android.widget.TextView;

/**
 * @author abbas
 * @brief description
 * @date 2022-01-27
 */
public class TextUtils {

    private static TextUtils instances;

    //已弃用 感觉繁琐 干脆静态
    @Deprecated
    public static TextUtils getInstances() {
        if (instances == null){
            instances = new TextUtils();
        }
        return instances;
    }

    public static boolean isEmpty(String target){
        if (target == null) return true;
        if ("".equals(target.trim())) return true;
        return false;
    }

    public static boolean hasEmpty(TextView... target){
        for (TextView t:target) {
            if (isEmpty(t.getText().toString().trim())){
                return true;
            }else {
                continue;
            }
        }
        return false;
    }
}

